﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SIPPaser.Mod
{
    /// <summary>
    /// SIP消息定义
    /// </summary>
    public class SipMessage
    {
        public DateTime Time { get; set; }  // 消息发送的时间
        public SIPMessageType MessageType { get; set; } // 消息类型
        public ProtocolType ProtocolType { get; set; }  // 协议类型
        public string SrcIP { get; set; }   // 源IP
        public int SrcPort { get; set; }    // 源端口
        public string DstIP { get; set; }   // 目的IP
        public int DstPort { get; set; }    // 目的端口

        public int? StatusCode { get; set; }    // 状态码

        public string CallID { get; set; }  // CallID   一个callID表示一个业务流程，一次通话CallID不变
        public string FromSIPUrl { get; set; }
        public string FromTag { get; set; }
        public string ToSIPUrl { get; set; }
        public string ToTag { get; set; }

        public string SIPBody { get; set; }

        public override string ToString()
        {
            return string.Format("Time:{0:HH-mm-ss}", Time);    //打印time字段
        }
    }
}
